<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>修改对方当事人信息</title>
	<meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
</head>
<body>
		<div align="center">
			<font size="4">对方当事人名称:</font>
			<input type="text"  id="partyname" style="width: 220px;height: 30px;">
	        <input type="button" value="修改" id="submit">
		</div>

<script src="../../../layuiadmin/jquery/jquery.min.js" type="text/javascript"></script>
<script src="../../../layuiadmin/layui/layui.js"></script>
<script type="text/javascript">
	$(function(){
		layui.use('form', function(){
        var form = layui.form; 
        form.render();
   	});
	    var parentData=(parent.parentData);
		$("#partyname").val(parentData.clientName);
		$("#submit").click(function(){
			var partyname=$("#partyname").val();
			if(partyname!=""&&partyname!=null){
					if(partyname!=parentData.clientName){
						$.ajax({
							type:"post",
							url:"http://localhost:8080/client/updateclient",
							async:true,
							data:{"clientId":parentData.clientId,"clientName":partyname},
							success:function(date){
								if(date=="succeed"){
									alert("修改成功！");
									var index = parent.layer.getFrameIndex(window.name); 
									parent.layer.close(index);
								}else{
									alert("亲！系统繁忙中！请稍后~~");
								}
							}
						});
					}else{
						alert("未进行进行修改！");
						var index = parent.layer.getFrameIndex(window.name); 
						parent.layer.close(index);
					}
			}else{
				alert("对方当事人名称不能为空！");		
			}
			});
	});
</script> 
</body>
</html>
